/**
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const declare_1 = require("../declare");
const util_1 = require("../util");
const { ext } = util_1.config;
exports.LangTypes = {
    [ext.js]: {
        requestType: declare_1.RequestType.SCRIPT,
        compileType: undefined
    },
    [ext.json]: {
        requestType: declare_1.RequestType.JSON,
        compileType: undefined
    },
    [ext.png]: {
        requestType: declare_1.RequestType.IMAGE,
        compileType: undefined
    },
    [ext.jpg]: {
        requestType: declare_1.RequestType.IMAGE,
        compileType: undefined
    },
    [ext.jpeg]: {
        requestType: declare_1.RequestType.IMAGE,
        compileType: undefined
    },
    [ext.gif]: {
        requestType: declare_1.RequestType.IMAGE,
        compileType: undefined
    },
    [ext.webp]: {
        requestType: declare_1.RequestType.IMAGE,
        compileType: undefined
    },
    [ext.eot]: {
        requestType: declare_1.RequestType.ICONFONT,
        compileType: undefined
    },
    [ext.svg]: {
        requestType: declare_1.RequestType.ICONFONT,
        compileType: undefined
    },
    [ext.ttf]: {
        requestType: declare_1.RequestType.ICONFONT,
        compileType: undefined
    },
    [ext.woff]: {
        requestType: declare_1.RequestType.ICONFONT,
        compileType: undefined
    },
    [ext.wxs]: {
        requestType: declare_1.RequestType.WXS,
        compileType: undefined
    },
    [ext.wxml]: {
        requestType: declare_1.RequestType.TEMPLATE,
        compileType: undefined
    },
    [ext.wxss]: {
        requestType: declare_1.RequestType.STYLE,
        compileType: undefined
    },
    [ext.less]: {
        requestType: declare_1.RequestType.STYLE,
        compileType: declare_1.CompileType.LESS
    },
    [ext.pcss]: {
        requestType: declare_1.RequestType.STYLE,
        compileType: declare_1.CompileType.PCSS
    },
    [ext.wxa]: {
        requestType: declare_1.RequestType.WXA,
        compileType: undefined
    },
    [ext.wxp]: {
        requestType: declare_1.RequestType.WXP,
        compileType: undefined
    },
    [ext.wxc]: {
        requestType: declare_1.RequestType.WXC,
        compileType: undefined
    }
};
*/

import { RequestType, CompileType } from '.';
import { config } from '../util';

const { ext } = config;

/**
 * 请求类型与扩展名的匹配
 */
export const LangTypes: {
  [name: string]: {
    requestType: RequestType,
    compileType?: CompileType
  }
} = {
  // SCRIPT
  [ext.js]: {
    requestType: RequestType.SCRIPT,
    compileType: undefined
  },

  // JSON
  [ext.json]: {
    requestType: RequestType.JSON,
    compileType: undefined
  },

  // IMAGE
  [ext.png]: {
    requestType: RequestType.IMAGE,
    compileType: undefined
  },
  [ext.jpg]: {
    requestType: RequestType.IMAGE,
    compileType: undefined
  },
  [ext.jpeg]: {
    requestType: RequestType.IMAGE,
    compileType: undefined
  },
  [ext.gif]: {
    requestType: RequestType.IMAGE,
    compileType: undefined
  },
  [ext.webp]: {
    requestType: RequestType.IMAGE,
    compileType: undefined
  },

  // ICON
  [ext.eot]: {
    requestType: RequestType.ICONFONT,
    compileType: undefined
  },
  [ext.svg]: {
    requestType: RequestType.ICONFONT,
    compileType: undefined
  },
  [ext.ttf]: {
    requestType: RequestType.ICONFONT,
    compileType: undefined
  },
  [ext.woff]: {
    requestType: RequestType.ICONFONT,
    compileType: undefined
  },

  // WXS
  [ext.wxs]: {
    requestType: RequestType.WXS,
    compileType: undefined
  },

  // TEMPLATE
  [ext.wxml]: {
    requestType: RequestType.TEMPLATE,
    compileType: undefined
  },

  // STYLE
  [ext.wxss]: {
    requestType: RequestType.STYLE,
    compileType: undefined
  },
  [ext.less]: {
    requestType: RequestType.STYLE,
    compileType: CompileType.LESS
  },
  [ext.pcss]: {
    requestType: RequestType.STYLE,
    compileType: CompileType.PCSS
  },

  // SFC
  [ext.wxa]: {
    requestType: RequestType.WXA,
    compileType: undefined
  },
  [ext.wxp]: {
    requestType: RequestType.WXP,
    compileType: undefined
  },
  [ext.wxc]: {
    requestType: RequestType.WXC,
    compileType: undefined
  }
};
